<?php
namespace app\admin\model;

use traits\model\SoftDelete;

class Warehouse extends Base
{
    use SoftDelete;
    public function admin()
    {
        return $this->hasOne("Admin","id","warehouse_admin_id")->bind("username");
    }

    public function addWarehouse($uid,$shop_name){
        $new=[
            'uid'=>$uid,
            'type'=>3,
            'warehouse_name'=>$shop_name,
        ];
        $res = $this->dataUpdate($new);
        if(!$res){
            return false;
        }else{
            return true;
        }
    }
}